package com.itheima.service.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.itheima.mapper.OrderMapper;
import com.itheima.pojo.Member;
import com.itheima.service.MobileLoginService;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * <h3>health94_pareant</h3>
 * <p></p>
 *
 * @author : hhw
 * @date : 2020-03-30 19:34
 **/
@Service(interfaceClass = MobileLoginService.class)
public class MobileLoginServiceImpl implements MobileLoginService {

    @Autowired
    private OrderMapper orderMapper;

    @Override
    public boolean checkMember(String telephone) {
        Member member = orderMapper.queryMember(telephone);
        if (member == null) {
            return false;
        } else {
            return true;
        }
    }
    @Override
    public void addMember(String telephone) {
        Member member = new Member();
        member.setPhoneNumber(telephone);
        orderMapper.addMember(member);
    }
}
